package com.itheima.service.impl;

import com.itheima.mapper.LoginMapper;
import com.itheima.pojo.KsClass;
import com.itheima.pojo.User;
import com.itheima.service.LoginService;
import net.minidev.json.JSONUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 28066
 * @version 1.0
 * @description: TODO
 * @date 2022/11/11 15:45
 */
@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    private LoginMapper loginMapper;

    @Override
    public User findByMobile(String mobile) {
        return loginMapper.findByMobile(mobile);
    }

    @Override
    public List<KsClass> findAllClass() {
        return loginMapper.findAllClass();
    }

    @Override
    public Integer findClassId(String mobile) {
        return loginMapper.findClassId(mobile);
    }

    @Override
    public KsClass findClass(Integer classId) {
        return loginMapper.findClass(classId);
    }

//------------------------------------------------------------------------------------------------

    @Override
    public User loginByMobileAndPassword(String mobile, String password) {
        return loginMapper.selectByMobileAndPassword(mobile,password);
    }
}
